package com.liustar.oplog.admin;

import com.liustar.oplog.aspect.InterfaceOpLog;
import com.liustar.oplog.model.OperationLog;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Leo
 */
@Component
public class OpLogUser implements InterfaceOpLog {

    @Override
    public String getName(HttpServletRequest request) {
        String userName = request.getParameter("userName");
        if (!StringUtils.isEmpty(userName)) {
            return userName;
        } else {
            return "";
        }
    }

    @Override
    public String doOpLog(OperationLog operationLog) {
        //TODO 必须实现这个接口
        return null;
    }


}
